home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
comm
/
www
/
WebYAM.lha
/
yam.rexx
< prev
Wrap
OS/2 REXX Batch file
|
2000-04-04
|
22KB
|
665 lines
/*
** $VER: WebYAM 1.0 (4.4.2000)
** © 2000 by Jacob Laursen <jlaur@mail1.stofanet.dk>
**
** Webbrowse YAM folders
**
** For "quoted printable" -> "8bit" conversion, please download
** comm/mail/YToolsNG.lha from Aminet and copy the file 'YTCunmime'
** to the YAM: directory, or correct the path below.
**
** Version 1.0 - Initial release.
**
** TODO:
** - User-configurable settings
** - Process mail to read (create links etc.)
*/
options results
options failat 11
/* YAM executable path */
YAMPath = 'YAM:YAM'
/* YAM folder file */
Cfg.YAMFolders = 'YAM:.folders'
/* YTCunmime executable path */
Cfg.UMPath = 'YAM:YTCunmime'
/* Misc. appearance options */
Cfg.MsgsPerPage = 25 /* Number of messages per page */
Cfg.NumColsQuick = 4 /* Number of columns in quick folder list */
Cfg.NumColsFull = 2 /* Number of columns in full folder list */
/* Color settings - only RRGGBB values accepted */
Cfg.FldrHdrColor = '333366'
Cfg.BgColor = 'eeeecc'
/* No user-serviceable parts below... */
say 'Content-type: text/html'; say ''
say '<HTML>'; say ''
say ' <HEAD>'
say ' <TITLE>Yet Another Mailer - Web Interface</TITLE>'
if ~show('P','YAM') then do
say ' <META HTTP-EQUIV="Refresh" CONTENT=30>'
say ' </HEAD>'; say ''
say ' <BODY BGCOLOR="#ffffff" TEXT="#000000">'
say ' <P>Please wait, loading YAM...</P>'
say ' </BODY>'
say '</HTML>'
address command 'run <>nil: ' || YAMPath || ' HIDE'
exit
end
say ' </HEAD>'; say ''
say ' <BODY BGCOLOR="#ffffff" TEXT="#000000">'
if ~show('L','rexxdossupport.library') then if ~addlib('rexxdossupport.library',0,-30,0) then do
say ' <P>Error: rexxdossupport.library couldn''t be opened!</P>'
say ' </BODY>'
say '</HTML>'
exit 10
end
'getvar QUERY_STRING'; query = result
call ParseArgs(query)
address 'YAM'
if Arg.Check = 1 then call GetMail
if Arg.Help = 1 then call Help
else if Arg.Compose = 1 then call ComposeMail
else if Arg.Send = 1 then call SendMail
else if Arg.List = 1 then call ListFolders
else if Arg.Folder > -1 then do
if Arg.Message > -1 then do
if Arg.Move = 1 then call MoveMail
else if Arg.Delete = 1 then call DeleteMail
else call ReadMessage(Arg.Folder, Arg.Message)
end
else do
if Arg.Move = 1 then call MoveMails(Arg.Folder, Arg.Page)
else if Arg.Delete = 1 then call DeleteMails(Arg.Folder, Arg.Page)
else call ListFolder(Arg.Folder, Arg.Page)
end
end
else call ListDeadFolders
say ' </BODY>'
say '</HTML>'
exit
ParseArgs: PROCEDURE EXPOSE Arg.
parse arg string
Arg.List = 0
Arg.Check = 0
Arg.Help = 0
Arg.Compose = 0
Arg.Send = 0
Arg.Signature = 0
Arg.Keep = 1
Arg.Folder = -1
Arg.DestFolder = -1
Arg.Message = -1
Arg.Page = 1
Arg.Delete = 0
Arg.Move = 0
Arg.Msgs.COUNT = 0
query = translate(string, ' ', '&')
do loop = 1 to words(query)
arg = word(query,loop)
if index(arg,'=') > 1 then do
cmd = left(arg,index(arg,'=')-1)
parse var arg cmd'='value
cmd = upper(cmd)
if cmd = 'FOLDER' then Arg.Folder = value
if cmd = 'DESTFOLDER' then Arg.DestFolder = value
if cmd = 'MESSAGE' then Arg.Message = value
if cmd = 'PAGE' then Arg.Page = value
if cmd = 'OPTION' & upper(value) = 'DELETE' then Arg.Delete = 1
if cmd = 'OPTION' & upper(value) = 'MOVE+TO' then Arg.Move = 1
if cmd = 'SEND' & upper(value) = 'SEND' then Arg.Send = 1
if cmd = 'TO' then Arg.Recipient = Convert(value)
if cmd = 'CC' then Arg.Cc = Convert(value)
if cmd = 'BCC' then Arg.Bcc = Convert(value)
if cmd = 'SUBJECT' then Arg.Subject = Convert(value)
if cmd = 'BODY' then Arg.Body = Convert(value)
if cmd = 'SIGNATURE' & upper(value) = 'ON' then Arg.Signature = 1
if cmd = 'KEEP' & upper(value) = 'OFF' then Arg.Keep = 0
if left(cmd,8) = 'MESSAGE.' then do
parse var arg dummy'.'num'='val
current = Arg.Msgs.COUNT
if upper(val) = 'ON' then do
Arg.Msgs.current = num
Arg.Msgs.COUNT = current + 1
end
end
end
else do
arg = upper(arg)
if arg = 'LIST' then Arg.List = 1
if arg = 'CHECK' then Arg.Check = 1
if arg = 'HELP' then Arg.Help = 1
if arg = 'COMPOSE' then Arg.Compose = 1
end
end
return
ParseFolders: PROCEDURE EXPOSE Cfg.
if ~exists(Cfg.YAMFolders) then return
call open(fh, Cfg.YAMFolders, 'R')
Cfg.FolderName.COUNT = 0
do while ~eof(fh)
line = readln(fh)
if word(line, 1) = '@FOLDER' then do
current = Cfg.FolderName.COUNT
Cfg.FolderName.current = 'F:'right(line,length(line)-8)
Cfg.FolderName.COUNT = current + 1
end
else if word(line, 1) = '@SEPARATOR' then do
current = Cfg.FolderName.COUNT
if length(line) > 11 then Cfg.FolderName.current = 'S:'right(line,length(line)-11)
else Cfg.FolderName.current = 'S:'
Cfg.FolderName.COUNT = current + 1
end
end
call close(fh)
return
GotoMail: PROCEDURE
parse arg num
SETMAIL num
if RC ~= 10 then return 0
else say ' <P>This mail does not exist -- please update message list.</P>'
return 10
GotoFolder: PROCEDURE
parse arg num
SETFOLDER num
if RC ~= 10 then return 0
else say ' <P>This folder does not exist -- please update folder list.</P>'
return 10
ListFolders: PROCEDURE EXPOSE Cfg.
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?list&check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#cccc99"><A HREF="yam.rexx?list"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
say ' <TABLE BORDER=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR BGCOLOR="#'Cfg.FldrHdrColor'">'
say ' <TD ALIGN="left"><FONT COLOR="#ffffff"><B>No.</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Folder</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Total</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Unread</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>New</B></FONT></TD>'
say ' </TR>'
i = 0
call GoBusy
do forever
SETFOLDER i
if RC = 10 then do
SETFOLDER i+1
if RC = 10 then leave
/* Workaround for separator lines. Two in a row still breaks this routine */
i = i + 1
iterate
end
FOLDERINFO STEM cfi.
say ' <TR BGCOLOR="#'Cfg.BgColor'">'
say ' <TD ALIGN="left">'cfi.NUMBER'</TD>'
say ' <TD ALIGN="left"><A HREF="yam.rexx?Folder='cfi.NUMBER'">'cfi.NAME'</A></TD>'
say ' <TD ALIGN="right">'cfi.TOTAL'</TD>'
say ' <TD ALIGN="right">'cfi.UNREAD'</TD>'
say ' <TD ALIGN="right">'cfi.NEW'</TD>'
say ' </TR>'
i = i + 1
end
APPNOBUSY
say ' </TABLE>'; say
return
ListDeadFolders: PROCEDURE EXPOSE Cfg.
if ~exists(Cfg.YAMFolders) then do
call ListFolders
return
end
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#cccc99"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?list"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
call ParseFolders
say ' <TABLE BORDER=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR BGCOLOR="#'Cfg.FldrHdrColor'">'
do loop = 0 to Cfg.NumColsQuick-1
say ' <TD><FONT COLOR="#ffffff"><B>No.</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Folder</B></FONT></TD>'
end
say ' </TR>'
step = Cfg.FolderName.COUNT/Cfg.NumColsQuick
if trunc(step) ~= step then step = trunc(step)+1
do mainloop = 0 to step-1
say ' <TR BGCOLOR="#'Cfg.BgColor'">'
do loop = 0 to Cfg.NumColsQuick-1
current = mainloop+loop*step
if current > Cfg.FolderName.COUNT-1 then leave
if left(cfg.FolderName.current, 2) = 'F:' then do
say ' <TD>'current'</TD>'
say ' <TD><A HREF="yam.rexx?Folder='current'">'right(cfg.FolderName.current, length(cfg.FolderName.current)-2)'</A></TD>'
end
end
say ' </TR>'
end
say ' </TABLE>'; say
return
DeleteMail: PROCEDURE EXPOSE Arg. Cfg.
Arg.Msgs.COUNT = 1
Arg.Msgs.0 = Arg.Message
call DeleteMails(Arg.Folder, Arg.Page)
return
DeleteMails: PROCEDURE EXPOSE Arg. Cfg.
parse arg folder, page
call GoBusy
RC = GotoFolder(folder)
if RC = 10 then do
APPNOBUSY
return
end
do loop=Arg.Msgs.COUNT-1 to 0 by -1
RC = GotoMail(Arg.Msgs.loop)
if RC = 10 then leave
MAILDELETE 'FORCE'
end
APPNOBUSY
call ListFolder(folder, page)
return
MoveMail: PROCEDURE EXPOSE Arg. Cfg.
Arg.Msgs.COUNT = 1
Arg.Msgs.0 = Arg.Message
call MoveMails(Arg.Folder, Arg.Page)
return
MoveMails: PROCEDURE EXPOSE Arg. Cfg.
parse arg folder, page
call GoBusy
RC = GotoFolder(folder)
if RC = 10 then do
APPNOBUSY
return
end
do loop=Arg.Msgs.COUNT-1 to 0 by -1
RC = GotoMail(Arg.Msgs.loop)
if RC = 10 then leave
MAILMOVE Arg.DestFolder
end
APPNOBUSY
call ListFolder(folder, page)
return
ListFolder: PROCEDURE EXPOSE Cfg.
parse arg folder, page
call ParseFolders
call GoBusy
RC = GotoFolder(folder)
if RC = 10 then do
APPNOBUSY
return
end
FOLDERINFO STEM fi.
start = Cfg.MsgsPerPage * (page-1)
end = Cfg.MsgsPerPage * page
if end >= fi.TOTAL then end = fi.TOTAL
pages = trunc((fi.TOTAL-1)/Cfg.MsgsPerPage)+1
say ' <FORM NAME="WebYAM" ACTION="yam.rexx">'
say ' <INPUT TYPE="hidden" NAME="Folder" VALUE="'folder'">'
say ' <INPUT TYPE="hidden" NAME="Page" VALUE="'page'">'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR>'
say ' <TD COLSPAN=1 ALIGN="left"><FONT SIZE=+2><B>Folder: 'right(Cfg.FolderName.folder, length(Cfg.FolderName.folder)-2)'</B></FONT></TD>'
pageinfo = ' <TD COLSPAN=4 ALIGN="right">Page 'page' of 'pages' ['
do loop = 1 to pages
if loop = page then pageinfo = pageinfo' 'loop
else pageinfo = pageinfo' <A HREF="yam.rexx?Folder='folder'&Page='loop'">'loop'</A>'
end
say pageinfo' ]</TD>'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Folder='folder'&check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?list"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR BGCOLOR="#'Cfg.FldrHdrColor'">'
say ' <TD><IMG SRC="pics/newmail.gif" WIDTH=11 HEIGHT=11 ALT="New" HSPACE=5></TD>'
say ' <TD HEIGHT=23> </TD>'
say ' <TD ALIGN="left"> <FONT COLOR="#ffffff"><B>No.</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Name</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Subject</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Date</B></FONT></TD>'
say ' <TD ALIGN="center"><FONT COLOR="#ffffff"><B>Size</B></FONT></TD>'
say ' <TD ALIGN="right"><FONT COLOR="#ffffff"><B>Flags</B></FONT> </TD>'
say ' </TR>'
do loop = start to end-1
SETMAIL loop
MAILINFO STEM sel.
if index(sel.FROM,'<') ~= 0 then email = left(sel.FROM,index(sel.FROM,'<')-2)
else email = sel.FROM
say ' <TR BGCOLOR="#'Cfg.BgColor'">'
if sel.STATUS = 'U' | sel.STATUS = 'N' then say ' <TD><IMG SRC="pics/newmail.gif" WIDTH=11 HEIGHT=11 ALT="New" HSPACE=5></TD>'
else say ' <TD> </TD>'
say ' <TD><INPUT TYPE="checkbox" NAME="Message.'loop'"></TD>'
say ' <TD ALIGN="left" NOWRAP> 'sel.INDEX'</TD>'
estr = ' <TD ALIGN="left" NOWRAP> '
if left(sel.FLAGS,1) = 'M' then estr = estr'<IMG SRC="pics/status_group.gif" WIDTH=19 HEIGHT=9 ALT="M"> '
estr = estr'<A HREF="yam.rexx?Folder='folder'&Message='sel.INDEX'">'email'</A></TD>'
say estr
say ' <TD ALIGN="left" NOWRAP> 'sel.SUBJECT'</TD>'
say ' <TD ALIGN="left" NOWRAP> 'sel.DATE'</TD>'
say ' <TD ALIGN="right" NOWRAP>'sel.SIZE' </TD>'
imgstat = ' <TD ALIGN="right" NOWRAP>'
if substr(sel.FLAGS,2,1) = 'A' then imgstat = imgstat'<IMG SRC="pics/status_attach.gif" WIDTH=9 HEIGHT=10 ALT="A"> '
if substr(sel.FLAGS,3,1) = 'R' then imgstat = imgstat'<IMG SRC="pics/status_report.gif" WIDTH=6 HEIGHT=10 ALT="R"> '
if substr(sel.FLAGS,4,1) = 'C' then imgstat = imgstat'<IMG SRC="pics/status_crypt.gif" WIDTH=6 HEIGHT=9 ALT="C"> '
if substr(sel.FLAGS,5,1) = 'S' then imgstat = imgstat'<IMG SRC="pics/status_signed.gif" WIDTH=6 HEIGHT=9 ALT="S"> '
if sel.STATUS = 'O' then imgstat = imgstat'<IMG SRC="pics/status_old.gif" WIDTH=25 HEIGHT=10 ALT="O">'
else if sel.STATUS = 'N' then imgstat = imgstat'<IMG SRC="pics/status_new.gif" WIDTH=25 HEIGHT=10 ALT="N">'
else if sel.STATUS = 'R' then imgstat = imgstat'<IMG SRC="pics/status_reply.gif" WIDTH=25 HEIGHT=10 ALT="R">'
else if sel.STATUS = 'U' then imgstat = imgstat'<IMG SRC="pics/status_unread.gif" WIDTH=25 HEIGHT=10 ALT="U">'
else if sel.STATUS = 'F' then imgstat = imgstat'<IMG SRC="pics/status_forward.gif" WIDTH=25 HEIGHT=10 ALT="F">'
else if sel.STATUS = 'S' then imgstat = imgstat'<IMG SRC="pics/status_sent.gif" WIDTH=25 HEIGHT=10 ALT="S">'
else if sel.STATUS = 'W' then imgstat = imgstat'<IMG SRC="pics/status_waitsend.gif" WIDTH=25 HEIGHT=10 ALT="W">'
else if sel.STATUS = 'H' then imgstat = imgstat'<IMG SRC="pics/status_hold.gif" WIDTH=25 HEIGHT=10 ALT="H">'
else if sel.STATUS = 'E' then imgstat = imgstat'<IMG SRC="pics/status_error.gif" WIDTH=25 HEIGHT=10 ALT="E">'
say imgstat' </TD>'
say ' </TR>'
end
APPNOBUSY
say ' <TR><TD HEIGHT=12></TD></TR>'
say ' <TR>'
temp = ' <TD VALIGN="top" ALIGN="right" COLSPAN=8> [ '
if page = 1 then temp = temp'Prev Page'
else temp = temp'<A HREF="yam.rexx?Folder='folder'&Page='page-1'">Prev Page</A>'
temp = temp' | '
if page = pages then temp = temp'Next Page'
else temp = temp'<A HREF="yam.rexx?Folder='folder'&Page='page+1'">Next Page</A>'
say temp' ]</TD>'
say ' </TR>'
say ' </TABLE>'; say
call MakeMoveTo(folder)
say ' </FORM>'
return
ReadMessage: PROCEDURE EXPOSE Cfg.
parse arg folder, message
call GoBusy
RC = GotoFolder(folder)
if RC = 10 then do
APPNOBUSY
return
end
RC = GotoMail(message)
if RC = 10 then do
APPNOBUSY
return
end
call ParseFolders
FOLDERINFO STEM cfi.
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Folder='folder'&Message='message'&Check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Folder='folder'"><B>'cfi.NAME'</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?List"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
MAILEXPORT 'T:YAM-TextMode.tmp'
if exists(Cfg.UMPath) = 1 then address command Cfg.UMPath || ' MAIL=T:YAM-TextMode.tmp'
say ' <PRE>'
address command 'Type T:YAM-TextMode.tmp'
say ' </PRE>'
address command 'Delete >NIL: T:YAM-TextMode.tmp'
MAILINFO STEM sel.
if sel.STATUS = 'N' | sel.STATUS = 'U' then MAILSTATUS 'O'
APPNOBUSY
say ' <FORM NAME="WebYAM" ACTION="yam.rexx">'
say ' <INPUT TYPE="hidden" NAME="Folder" VALUE="'folder'">'
say ' <INPUT TYPE="hidden" NAME="Message" VALUE="'message'">'
call ParseFolders
call MakeMoveTo(folder)
say ' </FORM'
return
GetMail: PROCEDURE
MAILCHECK
return
ComposeMail: PROCEDURE
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=1 WIDTH="100%">'
say ' <TR ALIGN="center">'
say ' <TD BGCOLOR="#cccc99"><A HREF="yam.rexx?Compose"><B>Compose</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Compose&Check"><B>Get mail</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx"><B>Folders</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?List"><B>Folders (full)</B></A></TD>'
say ' <TD BGCOLOR="#336699"><A HREF="yam.rexx?Help"><B>Help</B></A></TD>'
say ' </TR>'
say ' </TABLE>'
say ' <FORM NAME="composeform" ACTION="yam.rexx">'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>'
say ' <TR VALIGN="top">'
say ' <TD COLSPAN=2 ALIGN="center">'
say ' <INPUT TYPE="submit" NAME="Send" VALUE="Send">'
say ' <INPUT TYPE="submit" NAME="Cancel" VALUE="Cancel">'
say ' </TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>To:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="To" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Cc:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="Cc" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Bcc:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="Bcc" VALUE="" SIZE=65 MAXLENGTH=1000</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="right" NOWRAP><B>Subject:</B></TD>'
say ' <TD ALIGN="left"><INPUT TYPE="text" NAME="Subject" VALUE="" SIZE=65 MAXLENGTH=80</TD>'
say ' </TR>'
say ' <TR>'
say ' <TD></TD>'
say ' <TD HEIGHT=30 VALIGN="middle">'
say ' <INPUT TYPE="checkbox" NAME="Signature" VALUE="on">Add signature'
say ' <INPUT TYPE="checkbox" NAME="Keep" VALUE="off">Delete when sent'
say ' </TD>'
say ' </TR>'
say ' </TABLE>'
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>'
say ' <TR>'
say ' <TD ALIGN="center">'
say ' <TEXTAREA NAME="Body" ROWS=30 COLS=74 WRAP="soft"></TEXTAREA>'
say ' </TD>'
say ' </TR>'
say ' </TABLE>'
say ' </FORM>'
return
SendMail: PROCEDURE EXPOSE Arg.
/*
say 'To: 'Arg.Recipient'<BR>'
say 'Subject: 'Arg.Subject'<BR>'
say 'Body: 'Arg.Body'<BR>'
*/
call open(fh, 'T:WebYAM-write.tmp', 'W')
call writeln(fh, Arg.body)
call close(fh)
call GoBusy
MAILWRITE
WRITETO '"'Arg.Recipient'"'
if Arg.Cc ~= 'ARG.CC' then WRITECC '"'Arg.Cc'"'
if Arg.Bcc ~= 'ARG.BCC' then WRITEBCC '"'Arg.Bcc'"'
WRITESUBJECT '"'Arg.Subject'"'
WRITELETTER 'T:WebYAM-write.tmp'
opts = ''
if Arg.Signature = 0 then opts = 'SIG=0'
if Arg.Keep = 0 then opts = opts' DELETE'
if opts ~= '' then WRITEOPTIONS opts
WRITESEND
APPNOBUSY
address command 'Delete >NIL: T:WebYAM-write.tmp'
say ' <P>Your mail was succesfully sent.</P>'
return
Help: PROCEDURE
say ' <H1>WebYAM 1.0 by Jacob Laursen</H1>'; say
say ' <P>Browse your YAM folders through the World Wide Web.</P>'
say ' <P>'
say ' Author''s e-mail address: <A HREF="mailto:laursen@myself.com">laursen@myself.com</A><BR>'
say ' WebYAM homepage: <A HREF="http://home.worldonline.dk/~jlaur/amiga/webyam/">http://home.worldonline.dk/~jlaur/amiga/webyam/</A><BR>'
say ' Status icons by Ash Thomas'
say ' </P>'
return
Convert: PROCEDURE
parse arg dummy
dummy = translate(dummy, ' ', '+')
do until pos=0
pos=index(dummy,'%')
if pos>0 then do
hex=substr(dummy,pos+1,2)
char=x2c(hex)
if pos=1 then dummy=char||substr(dummy,pos+3)
if pos>1 & pos<length(dummy)-2 then dummy=left(dummy,pos-1)||char||substr(dummy,pos+3)
if pos=length(dummy)-2 then dummy=left(dummy,pos-1)||char
end
end
return dummy
GoBusy: PROCEDURE
APPBUSY 'TEXT="WebYAM is working, please wait..."'
return
MakeMoveTo: PROCEDURE EXPOSE Cfg.
parse arg folder
say ' <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>'
say ' <TR>'
say ' <TD ALIGN="center"><INPUT TYPE="submit" NAME="Option" VALUE="Move to"></TD>'
say ' <TD ALIGN="left" COLSPAN=2><SELECT NAME="DestFolder">'
do loop = 0 to Cfg.FolderName.COUNT-1
if loop = folder then iterate
if left(Cfg.FolderName.loop, 2) = 'F:' then say ' <OPTION VALUE="'loop'">'right(Cfg.FolderName.loop,length(Cfg.FolderName.loop)-2)
end
say ' </SELECT></TD>'
say ' </TR>'
say ' <TR>'
say ' <TD ALIGN="center"><INPUT TYPE="submit" NAME="Option" VALUE="Delete"></TD>'
say ' </TR>'
say ' </TABLE>'
return